package djistra;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * @author wanyuxiang
 * @version 1.0
 * @project Java_base
 * @create 2019-08-26 15:03
 **/
public class Test {
    public static void main(String[] args) {
        List<Vertex> vertexs = new ArrayList<>();
        Vertex a = new Vertex("A", 0);
        Vertex b = new Vertex("B");
        Vertex c = new Vertex("C");
        Vertex d = new Vertex("D");
//        Vertex e = new Vertex("E");
//        Vertex f = new Vertex("F");
        vertexs.add(a);
        vertexs.add(b);
        vertexs.add(c);
        vertexs.add(d);
//        vertexs.add(e);
//        vertexs.add(f);
        int[][] edges = {
                {Integer.MAX_VALUE, 2, 3, 4},
                {2, Integer.MAX_VALUE, 5, 4},
                {3, 5, Integer.MAX_VALUE, 3},
                {4, 4, 3, Integer.MAX_VALUE},
        };
        Graph graph = new Graph(vertexs, edges);
        graph.printGraph();
        graph.search();
//        graph.printSSSP();
        List<Vertex> list = graph.line.getResult();
        System.out.println(list);
        Collections.reverse(list);
        System.out.println(list);
    }
}
